In my work, I've been asked to supply a means of supporting highlighting (i.e. colors, not selection of text) in DOORS so we can easily indicate changes in a module. I've done this by creating a script to manually insert highlighting rich text tags at the beginning and end of an object. This script is bound to a key combination so that the user can press a couple of keys and choose from 1 of 4 colors to highlight an object. However, there's a limitation. The entire object is highlighted. I've received multiple requests from people to try and expand the functionality of this script so that individual words within an object may be highlightable. I've shied away from this in the past because it can involve a lot of RTF parsing which I'm not too enthusiastic about, but I recently decided to revisit this problem and see if I could make any headway with it. The first obstacle that has reared its head is that I have no way of knowing what the cursor position within an object is when the user attempts to apply highlighting. There is a getCursor function or something similar to that, but if the user has a range of text selected, that function only seems to return the end of the selection. Is there a way to get the beginning of the selection as well?
|
Re: Cursor Position within Object Text Did you ever solve this problem? I've just attempted to do something similar to what you described (finding cursor position within rich text), and have been stymied. If you found a solution, I would love to benefit from your knowledge, experience, and solution. Thank you! |